<?php
namespace App\Listener;

use App\Rpc\Lib\MessageInterface;
use App\Rpc\Lib\OrderInterface;
use Six\Rpc\Client\Annotation\Mapping\Reference;
use Six\Rpc\Client\ServiceContext;
use Swoft\Context\Context;
use Swoft\Event\Annotation\Mapping\Listener;
use Swoft\Event\EventHandlerInterface;
use Swoft\Event\EventInterface;
use Swoft\Redis\Pool;
use Swoft\Server\Swoole\SwooleEvent;
/**
 * Class MessageStatusListener
 * @package App\Listener
 * @Listener(SwooleEvent::START)
 */
class MessageStatusListener implements EventHandlerInterface
{
    /**
     * 在程序初始化的时候定义好服务降级处理类
     * @Reference(pool="order.pool" , fallback="OrderFallback")
     *
     * @var OrderInterface
     */
    private $orderService;

    /**
     * 消息确认并投递
     * @Reference(pool="message.pool" , fallback="MessageFallback")
     *
     * @var MessageInterface
     */
    private $messageService;

    public function handle(EventInterface $event): void
    {

//        //自动初始化一个Context上下文对象(协程环境下)
//        $context = ServiceContext::new();
//        Context::set($context);

    }
}
























